home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC]
/
NeXTSTEP 3.3 Dev Intel.iso
/
NextDeveloper
/
Headers
/
btree
/
protocols.h
< prev
Wrap
Text File
|
1993-08-15
|
6KB
|
184 lines
/*
protocols.h
Copyright 1991,NeXT Computer,Inc.
*/
#import <store/protocols.h>
typedef int
IXComparator(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
#ifdef NX_COMPILER_RELEASE_3_0
@protocol IXComparatorSetting
#else NX_COMPILER_RELEASE_3_0
@interface Object(IXComparatorSetting)
#endif NX_COMPILER_RELEASE_3_0
// context is arbitrary, caller supplied pointer passed to comparator.
// comparator is not saved across free/init.
- getComparator:(IXComparator **)comparator andContext:(const void **)context;
- setComparator:(IXComparator *)comparator andContext:(const void *)context;
@end
#ifdef NX_COMPILER_RELEASE_3_0
@protocol IXComparisonSetting
#else NX_COMPILER_RELEASE_3_0
@interface Object(IXComparisonSetting)
#endif NX_COMPILER_RELEASE_3_0
// caller supplied comparator is cleared, and format string is installed
// format string is not saved across free/init.
- (const char *)comparisonFormat;
- setComparisonFormat:(const char *)aFormat;
@end
#ifdef NX_COMPILER_RELEASE_3_0
@protocol IXCursorPositioning
#else NX_COMPILER_RELEASE_3_0
@interface Object(IXCursorPositioning)
#endif NX_COMPILER_RELEASE_3_0
- (BOOL)setFirst; // positions cursor at first key in key space
- (BOOL)setLast; // positions cursor at last key in key space
- (BOOL)setNext; // positions cursor at next key in key space
- (BOOL)setPrevious; // position cursor at previous key in key space
- (BOOL)getKey:(const void **)key // returns value of key at cursor
andLength:(unsigned *)length;
- (BOOL)setKey:(const void *)key // positions cursor at supplied key
andLength:(unsigned)length;
- (BOOL)isMatch; // true if cursor matched a key on last operation
@end
// a weighted reference to something that can be described by a handle.
// note that the weight is not interpreted, and may be any unsigned value,
// such as a hint or a another handle.
typedef struct IXPosting {
unsigned handle;
unsigned weight;
} IXPosting;
#ifdef NX_COMPILER_RELEASE_3_0
@protocol IXPostingExchange
#else NX_COMPILER_RELEASE_3_0
@interface Object(IXPostingExchange)
#endif NX_COMPILER_RELEASE_3_0
// a copy of the receiver's postings is returned by get. caller must free.
// set does not consume the copy.
- getCount:(unsigned *)theCount andPostings:(IXPosting **)thePostings;
- setCount:(unsigned)theCount andPostings:(const IXPosting *)thePostings;
@end
#ifdef NX_COMPILER_RELEASE_3_0
@protocol IXPostingOperations
#else NX_COMPILER_RELEASE_3_0
@interface Object(IXPostingOperations)
#endif NX_COMPILER_RELEASE_3_0
- addHandle:(unsigned)handle withWeight:(unsigned)weight;
- removeHandle:(unsigned)handle;
- empty;
- (unsigned)count;
// for iterating over the handles. zero is returned at end of list.
- (unsigned)setFirstHandle;
- (unsigned)setNextHandle;
// sets to the supplied handle, or if not found, to the next larger handle
- (unsigned)setHandle:(unsigned)handle;
- (unsigned)getHandle:(unsigned *)handle andWeight:(unsigned *)weight;
@end
// default comparator routines for use with IXBTree.
extern int
IXFormatComparator(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, void *format);
extern int
IXCompareStrings(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareMonocaseStrings(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareBytes(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareShort(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareShorts(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareLong(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareLongs(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareUnsignedBytes(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareUnsignedShort(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareUnsignedShorts(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareUnsignedLong(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareUnsignedLongs(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareFloat(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareFloats(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareDouble(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareDoubles(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareStringAndUnsigneds(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);
extern int
IXCompareUnsignedAndStrings(const void *data1, unsigned short length1,
const void *data2, unsigned short length2, const void *context);